package com.literature.search.core.entity.esindex;

import cn.easyes.annotation.IndexField;
import cn.easyes.annotation.IndexId;
import cn.easyes.annotation.IndexName;
import cn.easyes.annotation.rely.Analyzer;
import cn.easyes.annotation.rely.FieldType;
import cn.easyes.annotation.rely.IdType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
 * @Author: DangKong
 * @Date: 2023/3/2 21:43
 * @Description: 存在ES中的父对象
 */



@Data
@ApiModel("ES中每一页的文本内容")
@IndexName("documentpage_cn")
public class CNEsPageObject implements Serializable {

    private static final long serialVersionUID = 1L;



    @IndexId(type = IdType.CUSTOMIZE)
    @ApiModelProperty("每页文本内容ID,这里存储grifsid,不索引")
    private String id;


    @ApiModelProperty("所在页码")
    @IndexField(
            fieldType = FieldType.INTEGER
    )
    private Integer pageNumber;

    @ApiModelProperty("页面内容")
    @IndexField(
            fieldType = FieldType.TEXT,
            analyzer = Analyzer.IK_SMART,  //索引文档时用的分词器
            searchAnalyzer = Analyzer.IK_MAX_WORD //查询分词器
    )
    private String content;

    @ApiModelProperty("标签")
    @IndexField(
            fieldType = FieldType.KEYWORD
    )
    private String tag;



}
